package cn.com.bluemoon.daps.system.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.com.bluemoon.daps.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.util.StringJoiner;

/**
 * <p>
 * 系统名称表（全称-简称）
 * </p>
 *
 * @author admin
 * @since 2020-09-09
 */
@Data
@Accessors
@ApiModel(value = "DapSystemNameAbbr", description = "系统名称表（全称-简称）")
public class DapSystemNameAbbr extends BaseModel<DapSystemNameAbbr> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "全称")
    @Excel(name = "词")
    private String fullName;

    @ApiModelProperty(value = "简称")
    @Excel(name = "缩写")
    private String abbrName;

    @ApiModelProperty(value = "语言类型 1中文  0/null英文")
    @Excel(name = "语言类型")
    private Integer type;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        DapSystemNameAbbr that = (DapSystemNameAbbr) o;

        return new EqualsBuilder()
                .appendSuper(super.equals(o))
                .append(fullName, that.fullName)
                .append(abbrName, that.abbrName)
                .append(type, that.type)
                .isEquals();
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", DapSystemNameAbbr.class.getSimpleName() + "[", "]")
                .add("fullName='" + fullName + "'")
                .add("abbrName='" + abbrName + "'")
                .add("type=" + type)
                .toString();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .appendSuper(super.hashCode())
                .append(fullName)
                .append(abbrName)
                .append(type)
                .toHashCode();
    }


}
